package cn.jiuxiaoer.job.domain;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author gzk
 * @date 2021/46/26 19:46
 */
public interface ShopDetailManager  extends BaseMapper<ShopDetail> {
    /**
     * 查询门店未出库商品-不包括过期临期商品
     * @param
     * @return
     */
    @Select("<script> " +
            "SELECT " +
            "  jd.id AS id,  " +
            "  jd.site_id AS siteId,  " +
            "  jd.shop_id AS shopId,  " +
            "  jd.production_date AS productionDate,  " +
            "  jd.expiry_date AS expiryDate,  " +
            "  jd.goods_status AS goodsStatus,  " +
            "  jd.store_status AS storeStatus,  " +
            "  jd.material_id AS materialId,  " +
            "  cm.goods_name AS materialName,  " +
            "  cm.goods_no AS materialNo,  " +
            "  cm.shelf_life AS shelfLife,  " +
            "  cm.critica_value AS criticaValue " +
            "FROM  " +
            "  `jxe_stock_shop_detail` jd " +
            "LEFT JOIN " +
            "   call_me_new_goods_manage cm ON jd.material_id = cm.id " +
            "WHERE  " +
            "  jd.deleted = 0 " +
            "  AND jd.goods_status in (0, 3, 4)  " +
            "  AND jd.store_status IN ( 0, 1 ) " +
            "</script>")
    List<ShopGoodsDetailDto> getGoodsDetailList();
}
